<div>
    <p class="alert alert-primary">npm install --save @ngx-translate/core</p>
    <p class="alert alert-primary">npm install --save @ngx-translate/http-loader</p>
</div>
<div>
    <h2>{{title|translate}}</h2>
    <label>
        {{'hello'|translate}}
        <select #langSelect (change)="translate.use(langSelect.value)">
            <!-- 事件必须有$event属性 -->
            <option *ngFor="let lang of translate.getLangs()" [value]="lang" [selected]="lang === translate.currentLang">
                <!--  [selected]="lang === translate.currentLang" -->
                {{lang}}</option>
        </select>
        <span class="badge badge-success">当前语言：{{currentLang}}</span>
    </label>
</div>
<button class="btn btn-primary" (click)="toggleLang()">{{'get-lang'|translate}}</button>